<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let tw={};
        //对象的添加的两种方式
        tw.name="唐玮";
        tw["age"]=25;
        console.log(tw);
    //删
delete tw.age;
console.log(tw);

//判断对象是否拥有属性
console.log(tw.hasOwnProperty(tw.age));//false

//判断自己和父级是否有的属性,(子级和父级都要判断)
console.log("toString" in tw); //true

//对象的组装，和展开语法一样
let web1={name:"唐玮"};
let web2={age:5};
let new_web=Object.assign(web1,web2);
console.log(new_web);//{name: '唐玮', age: 5}

    </script>
</body>
</html>